export default {
    name: 'pay',
    data() {
        return {
            totalPrice: 0,
            orderId: ''
        }
    },
    created() {
        console.log(this.$route.query);
        this.totalPrice = this.$route.query.data
        this.orderId = this.$route.query.orderId
    },
    methods: {
        pay() {
            let id = this.orderId
            this.axios.defaults.headers.common['Authorization'] = localStorage['token']
            this.axios.put('api/editOrder', { params: { orderId: id, state: 2 } })
                .then(res => {
                    this.$message({
                        type: 'success',
                        duration: 1000,
                        message: '支付成功'
                    });
                    this.$router.push('/index/personal/cart')
                })
        },
    }
}